package casa.depesos.app.com.http.req;


import java.util.Map;

import casa.depesos.app.com.http.HttpReq;
import casa.depesos.app.com.http.ReqCallback;
import casa.depesos.app.com.http.bean.GetCodeBean;
import casa.depesos.app.com.http.data.Me;
import casa.depesos.app.com.http.parser.GetCodeParser;
import casa.depesos.app.com.utils.Constant;

public class SaveInfoReq implements HttpReq<GetCodeBean> {

    Me info;

    public SaveInfoReq(Me map) {
        this.info = map;
    }

    @Override
    public Map getBody() {
        Map tmp = HttpReq.super.getBody();
        if (info.edu > 1) {
            tmp.put("eduid", (info.edu + 1));
        } else {
            tmp.put("eduid", info.edu);
        }
        tmp.put("resloc", info.addr);
        tmp.put("living", info.live);
        tmp.put("resdes", info.liveDes);
        tmp.put("relstatus", info.marry);
        tmp.put("emlacc", info.email);
        tmp.put("decision", info.option);
        tmp.put("mns", info.child);
        tmp.put("restype", info.house);
        tmp.put("wnum", info.app);
        tmp.put("bdate", info.birth);
        tmp.put("stype", info.sex);
        tmp.put("reqnum", Constant.getApplyId());

        return tmp;
    }

    @Override
    public void req(ReqCallback callback) {//   /app/cust/saveCustInfo
        req("/app/professionalData/preserveClientProfile", new GetCodeParser(), callback);
    }
}
